function loupe(detailLeft, maskbox, mask, bigimg) {
    detailLeft.onmouseenter = function () {
        maskbox.style.display = "block";
        mask.style.display = "block";
        // let currentX =
        //   (mask.offsetWidth * detailLeft.offsetWidth) / maskbox.offsetWidth;
        // let currentY =
        //   (mask.offsetHeight * detailLeft.offsetHeight) / maskbox.offsetHeight;
        // bigimg.style.width = currentX + "px";
        // bigimg.style.height = currentY + "px";
      };
      detailLeft.onmousemove = function (e) {
        let x = e.clientX - this.offsetLeft - maskbox.offsetWidth / 2;
        let y = e.clientY - this.offsetTop - maskbox.offsetHeight / 2;
        let maxX = this.offsetWidth - maskbox.offsetWidth;
        let maxY = this.offsetHeight - maskbox.offsetHeight;
        if (x <= 0) {
          x = 0;
        } else if (x >= maxX) {
          x = maxX;
        }
        if (y <= 0) {
          y = 0;
        } else if (y > maxY) {
          y = maxY;
        }
        // maskbox遮罩层盒子
        maskbox.style.left = x + "px";
        maskbox.style.top = y + "px";
        console.log(x, y);
        let bigmaxX = mask.offsetWidth - bigimg.offsetWidth;
        let bigmaxY = mask.offsetHeight - bigimg.offsetHeight;
    
        let bigX = (bigmaxX * x) / maxX;
        let bigY = (bigmaxY * y) / maxY;
    
        bigimg.style.left = bigX + "px";
        bigimg.style.top = bigY + "px";
      };
    
      detailLeft.onmouseleave = function () {
        maskbox.style.display = "none";
        mask.style.display = "none";
      };
    }

    // //放大镜功能
    // let detailLeft = document.querySelector(".detail-left")
    // let mask = document.querySelector(".mask");
    // // 遮罩层
    // let maskbox = document.querySelector(".maskbox");
    // let bigimg = mask.querySelector(".mask img");
    // loupe(detailLeft, maskbox, mask, bigimg);
    
    
    